/*!
 * Project Name: (Type Name Here)
 * File Build Date: Wed Sep 26 2012 00:39:37 GMT+0800 (CST)
 */
/* logging.js */
/*! logging.js version 1.0 */
/*jslint onevar: true, undef: true, eqeqeq: true, regexp: true, newcap: true, immed: true */
/*globals jQuery, console, window */
(function($){
	if (!window.console || !console.firebug)
	{
	    var i, defn = function(){}, 
	        names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
	    "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
	
	    window.console = {};
	    for (i = names.length; i--;) {
	        window.console[names[i]] = defn;
	    }
	}
	
	$.fn.log = function (msg) {
		console.log("%s: %o", msg, this); 
		return this;
	};
}(jQuery));

/* tabs.js */
/*
 * This is an example module.
 * Reading: http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth
 * 
 * Please copy and rename this file.
 * 
 */

/*globals jQuery, ND, window */
var ND = (function(ND, $) {
	
	//The create function creates the module object; It does no initialise the object
	ND.tabsModule = function () {
	
		/*
		 * Write private variables and functions here in this closure.
		 * They don't need to be just utility functions, they can refer to the private instance variables 
		 */
		var element;
		
		/*
		 * returns a new object that is the functionality of the module
		 * It has access to the private variables and functions declared in this closure.
		 */
		return {

			/*
			 * init Function. Needs to be called to initialise the new module object
			 * 
			 * eg. var myModule = ND.myModuleName()
			 *     myModule.init(); 
			 */
			init: function( elem ) { 
				
				/* Cache the jQuery instance of the element(s) this belongs too.
				 * Bake in default selectors. 
				 */
				element = $(elem || ".tabs");
					
				/* Check this module needs to be initalised for this page */
				if( !element || !element.size() ) { return; }
			
				$('div.tabs > ul >li > a').click(function(){
					var $this = $(this);
					var tabNum = $this.attr('rel');
					
					$('div.tabs > ul >li > a').removeClass('active');
					$this.addClass('active');
					
					$('div.tab-panel div.tab-content').removeClass('active');
					$('div.tab-panel div#'+tabNum).addClass('active');
					
					
					
					return false;
				});
				
				$('article.dialogue div.row:even').css({'background-color':'#DDDDDD'});
				
				return this;
			
			}
			
			/* Write Public Methods
			 * These will exist as methods on the new module object
			 * 
			 */
		
		
		};	
	};
	
	/* Return ND after it's been augmented */ 
	return ND;	

}(window.ND || {}, jQuery));
/* End File */

/* global.js */
/*globals jQuery, ND, window */
(function(ND, $){
	$(function($){

		//EXAMPLE: Initialise a module needed for the page.
		var tabsChange = ND.tabsModule().init();		
		
	});
}(window.ND || {}, jQuery));

